home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / amos / AMOSList-0998.lzh / AMOSLIST / 000103_bounce-amos-li…net@onelist.com_Sat Sep 5 10:28:03 1998.msg < prev    next >
Text File  |  1998-10-01  |  3KB  |  85 lines

  1. >From bounce-amos-list--963-mcox=access.digex.net@onelist.com  Sat Sep  5 10:28:03 1998
  2. Received: from onelist.com (pop.onelist.com [209.207.135.253])
  3.     by pony-2.mail.digex.net (8.8.8/8.8.8) with SMTP id KAA03446
  4.     for <mcox@access.digex.net>; Sat, 5 Sep 1998 10:28:03 -0400 (EDT)
  5. Received: (qmail 3535 invoked by alias); 5 Sep 1998 14:25:39 -0000
  6. Received: (qmail 3376 invoked from network); 5 Sep 1998 14:25:37 -0000
  7. Received: from unknown (HELO mailhost.sosbbs.com) (204.186.168.100) by pop.onelist.com with SMTP; 5 Sep 1998 14:25:37 -0000
  8. Received: from default (204.186.168.58) by mailhost.sosbbs.com (EMWAC SMTPRS 0.81) with SMTP id <B0000402644@mailhost.sosbbs.com>; Sat, 05 Sep 1998 10:26:24 -0400
  9. Message-ID: <B0000402644@mailhost.sosbbs.com>
  10. From: "Garfield Benjamin" <gbenjam@sosbbs.com>
  11. To: <amos-list@onelist.com>
  12. Date: Sat, 5 Sep 1998 10:47:28 -0400
  13. X-MSMail-Priority: Normal
  14. X-Priority: 3
  15. X-Mailer: Microsoft Internet Mail 4.70.1155
  16. Mailing-List: list amos-list@onelist.com; contact http://www.onelist.com
  17. Delivered-To: mailing list amos-list@onelist.com
  18. Precedence: bulk
  19. Reply-to: amos-list@onelist.com
  20. Mime-Version: 1.0
  21. Content-Type: text/plain; charset=ISO-8859-1
  22. Content-Transfer-Encoding: 7bit
  23. Subject: [amos-list] REPOSTING OF JOYSTICK CODE...
  24. Status: O
  25. X-Status: 
  26.  
  27. From: "Garfield Benjamin" <gbenjam@sosbbs.com>
  28.  
  29. ORIGINALLY SENT WEDNESDAY, NOW I AM RESENDING...
  30. ----------
  31.  
  32. >>> Hey! Look! At this Ne1 want a piece of joystick code... 
  33. >>Timer=0
  34. >>For A=0 To 100000
  35. >>   J=Joy(1) : K=J-2 : P#=J/4.0 : P=P# : I=Sgn(J)
  36. >>   If P#=P Then X=Sgn(J-6)*I 
  37. >>   If P=0 Then Y=I*(K+K+1)
  38. >>Next
  39. >>Print Timer
  40.  
  41. >> Hmm this seemed a bit too complicated, so I decided to check it out
  42. >>(and I managed to kill 5mins at the same time ;)
  43. >>Timer=0
  44. >>For A=0 To 100000
  45. >>   X=0 : Y=0
  46. >>   If Jup(1) Then Y=-1
  47. >>   If Jdown(1) Then Y=1
  48. >>   If Jleft(1) Then X=-1
  49. >>   If Jright(1) Then X=1
  50. >>Next
  51. >>Print Timer
  52.  
  53. Well, I live for writing compact, optimized code...
  54. THE OPTIMIZED WAY:
  55. Timer=0
  56. For REP=0 To 100000
  57.    X=Jleft(1)-Jright(1)
  58.    Y=Jup(1)-Jdown(1)
  59. Next REP
  60. Print Timer
  61.  
  62. Compiled with AMOS PRO Compiler and tested on a 14MHz NTSC
  63. Amiga... 
  64.  
  65. NO JOYSTICK MOVEMENT
  66.   First version: 779
  67.   Second version: 502
  68.   My version: 471
  69.  
  70. HOLDING DOWN ON JOYSTICK
  71.   First Version: 933
  72.   Second version: 511
  73.   My version: 476
  74.  
  75. Obviously, if tested on an accelerated Amiga the performance will be
  76. greatly increased (ie. smaller times) and it is much shorter as well.
  77.  
  78.  
  79.                 Garfield Benjamin    e-mail:gbenjam@sosbbs.com
  80.                      Website( http://www.sosbbs.com/~gbenjam
  81.  
  82. ------------------------------------------------------------------------
  83. To unsubscribe from this mailing list, or to change your subscription
  84. to digest, go to the ONElist web site, at http://www.onelist.com and
  85. select the User Center link from the menu bar on the left.